#include <iostream>
#include <unistd.h>
#include <cstdlib>
#include <pthread.h>

void* rout(void* arg){
    while(true){
        std::cout<<"i am a thread\n";
        sleep(1);
    }
}

int main()
{
    pthread_t tid;
    if(pthread_create(&tid,nullptr,rout,NULL)!=0){
        perror("pthread_create");
        exit(1);
    }
    while(true){
        std::cout<<"i am a main\n";
        sleep(1);
    }
    return 0;
}